/*
 * @Author: szx
 * @Date: 2022-03-01 13:59:42
 * @LastEditTime: 2022-03-01 14:07:43
 * @Description:
 * @FilePath: \leetcode\1800-1899\1848\1848.js
 */
/**
 * @param {number[]} nums
 * @param {number} target
 * @param {number} start
 * @return {number}
 */
 var getMinDistance = function (nums, target, start) {
    let res = Number.MAX_SAFE_INTEGER;
    for (let i = 0; i < nums.length; i++) if (nums[i] == target) res = Math.min(res,Math.abs(i - start));
    return res;
};
